# Maintainer: Antonio Rojas <arojas@archlinux.org>

_pipname=pplpy
pkgname=python-pplpy
pkgver=0.8.7
pkgrel=7
pkgdesc='Python wrapper to the C++ Parma Polyhedra Library (PPL)'
arch=(loong64 x86_64)
url='https://gitlab.com/videlec/pplpy/'
license=(LGPL2.1)
depends=(python-cysignals python-gmpy2 ppl)
makedepends=(cython python-setuptools python-sphinx)
source=(https://pypi.io/packages/source/${_pipname:0:1}/$_pipname/$_pipname-$pkgver.tar.gz)
sha256sums=('500bd0f4ae1a76956fae7fcba77854f5ec3e64fce76803664983763c3f2bd8bd')

build() {
  cd $_pipname-$pkgver
  python setup.py build

  _pythonver=`python -c "from sysconfig import get_python_version; print(get_python_version())"`
  PYTHONPATH="$PWD/build/lib.linux-$CARCH-cpython-${_pythonver/./}" make -C docs html
}

package() {
  cd $_pipname-$pkgver 
  python setup.py install --root="$pkgdir" --optimize=1 --skip-build

  mkdir -p "$pkgdir"/usr/share/doc/pplpy
  cp -r docs/build/html/* "$pkgdir"/usr/share/doc/pplpy
}
